<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue组件</title>
</head>

<body>
    <div id="app">
        <course v-for="item in items" v-bind:item="item"></course>

    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        Vue.component("course", {
            props: ['item'],
            template: ' <li>{{item}}</li>'
        });
        var vm = new Vue({
            el: "#app",
            data: {
                items: ["java", "Linux", "vue"]
            }
        });
    </script>
</body>

</html>